package pl.diagnoser.server.persistance.map;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "T_OBJECT_ATTRIBUTES")
public class ObjectAttributes implements Serializable {

	private static final long serialVersionUID = 1L;
	private long objectAttributes;
	private Objects objects;
	private String attribute;
	private String attributeValue;
	
	ObjectAttributes() {}
	
	public ObjectAttributes(Objects objects, String attributeDict,String attributeValue ) {
		this.objects = objects;
		this.attribute = attributeDict;
		this.attributeValue = attributeValue;
	}
	
	@Id
	@GeneratedValue
	@Column( name="OBJECT_ATTRIBUTES_ID", unique = true, nullable = false )
	public Long getObjectAttributes() {
		return this.objectAttributes;
	}
	
	public void setObjectAttributes( Long objectAttributes ) {
		this.objectAttributes = objectAttributes;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="OBJECT_ID")
	public Objects getObjects() {
		return objects;
	}

	public void setObjects(Objects objects) {
		this.objects = objects;
	}
	
	@Column( name="ATTRIBUTE_NAME", unique = false, nullable = false )
	public String getAttribute() {
		return attribute;
	}

	public void setAttribute(String attribute) {
		this.attribute = attribute;
	}
	
	@Column( name="ATTRIBUTE_VALUE_NAME", unique = false, nullable = false )
	public String getAttributeValue() {
		return attributeValue;
	}

	public void setAttributeValue(String attributeValue) {
		this.attributeValue = attributeValue;
	}
}
